home *** CD-ROM | disk | FTP | other *** search
/ Hyper Stacks 1994 May / Hyper Stacks (Pacific HiTech)(1994)[Mac].iso / HyperTalk / Volume / GetVolume⁄SetVolume / GetVolume_SetVolume / card_2857.txt < prev    next >
Encoding:
Text File  |  1988-02-16  |  2.2 KB  |  86 lines

  1. -- card: 2857 from stack: in
  2. -- bmap block id: 3191
  3. -- flags: 0000
  4. -- background id: 2810
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: A003
  11. -- rect: left=148 top=288 right=310 bottom=360
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Install GetVolume & SetVolume
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   put FileName( "STAK" ) into theTarget
  23.   if theTarget is empty then
  24.     beep 1
  25.     answer "Installation cancelled." with "Ok"
  26.   else
  27.     set cursor to 4 -- the watch
  28.     get second word of the long name of stack
  29.     put it into theSource
  30.     ResCopy value of theSource, theTarget, "XFCN", "GetVolume"
  31.     if "OK" is in the result then
  32.       ResCopy value of theSource, theTarget, "XCMD", "SetVolume"
  33.       if "OK" is in the result then answer "Installation complete." with "Ok"
  34.       else error "SetVolume"
  35.     else error "GetVolume"
  36.   end if
  37. end mouseUp
  38.  
  39. on error what
  40.   beep
  41.   answer "Unable to install " & what & "."  with "Cancel"
  42. end error
  43.  
  44.  
  45.  
  46. -- part 2 (field)
  47. -- low flags: 00
  48. -- high flags: 0001
  49. -- rect: left=42 top=83 right=261 bottom=467
  50. -- title width / last selected line: 0
  51. -- icon id / first selected line: 0 / 0
  52. -- text alignment: 0
  53. -- font id: 3
  54. -- text size: 12
  55. -- style flags: 0
  56. -- line height: 16
  57. -- part name: 
  58.  
  59.  
  60. -- part 3 (field)
  61. -- low flags: 00
  62. -- high flags: 0004
  63. -- rect: left=116 top=39 right=64 bottom=407
  64. -- title width / last selected line: 0
  65. -- icon id / first selected line: 0 / 0
  66. -- text alignment: 1
  67. -- font id: 6
  68. -- text size: 18
  69. -- style flags: 17408
  70. -- line height: 24
  71. -- part name: 
  72.  
  73.  
  74. -- part contents for card part 2
  75. ----- text -----
  76. GetVolume and SetVolume are an XFCN and XCMD that allow you to find out and set the volume of the speaker within a script.  The format of the commands are:
  77.      SetVolume(<volume>)
  78. and
  79.      GetVolume()
  80. Where <volume> is between 0 and 7.  The parenthesis are required for GetVolume to be recognized as a XFCN by HyperCard.
  81.  
  82. These routines where written by Steven Kienle [72330,111] in TML Pascal, source code is included in the StuffIt file with this Stack.
  83.  
  84. -- part contents for card part 3
  85. ----- text -----
  86. GetVolume & SetVolume